package com.tianshuo.listener.main;

import com.tianshuo.listener.service.OrderService;
import com.tianshuo.listener.config.ListenerConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class ListenerApplicationConetextTest {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
        applicationContext.register(ListenerConfig.class);
        applicationContext.refresh();
        OrderService orderService = applicationContext.getBean(OrderService.class);
        orderService.publish();

        System.out.println("事件触发结束！");
    }
}
